#include <stdio.h>

void printHTTPResponseHeader();
void printHTMLHead( void );
void printHTMLEnd( void );

void printForm(char* firstname, char* lastname, char* email, char* reenter, char* password, char* selectSex, char* Month, char* Day, char* Year)
{
    printf("<h1>Sign Up</h1>\n");
    printf("<p class =\"it\">It`s free and always will be.</p>\n");
    printf("<hr class=\"separator\" size=\"1\">\n");
    printf("<div class =\"main\">\n");
        printf("<div class =\"info\">\n");
            printf("<label for =\"1\">First Name:</label>\n");  
            printf("<input class =\"in\" input type=\"text\" name=\"firstName\"  value=\"%s\" size=\"35\" id=\"1\" readonly/> \n", firstname);
        printf("</div>\n");
        printf("<div class=\"info\">\n");
            printf("<label for=\"2\">Last Name:</label>\n");
            printf("<input class=\"in\" input type=\"text\" name=\"lastName\" value=\"%s\" size=\"35\" id=\"2\" readonly/> \n", lastname);
        printf("</div>\n");
        printf("<div class=\"info\">\n");
            printf("<label for =\"3\"> Your Email:</label>\n");  
            printf("<input class=\"in\" input type=\"text\" name=\"eMail\" value=\"%s\" size=\"35\" id=\"3\" readonly/> \n", email);
        printf("</div>\n");
        printf("<div class=\"info\">\n");
            printf("<label for=\"4\">Re-enter Email:</label>\n"); 
            printf("<input class=\"in\" input type=\"text\" name=\"reemail\" value=\"%s\" size=\"35\" id=\"4\" readonly> \n", reenter);
        printf("</div>\n");
        printf("<div class=\"info\">\n");
            printf("<label for=\"5\">New Password:</label>\n"); 
            printf("<input class = \"in\" input type=\"password\" name=\"password\" value=\"%s\" size=\"35\" id=\"5\" readonly/> \n", password);
        printf("</div>\n");
        printf("<div class=\"info\">\n");
            printf("<label for=\"select\">I am:</label>\n");
                printf("<select class=\"select\" select name=\"sex\" size=\"1\" id=\"select\" readonly>\n");
                   
                    printf("<option>%s</option>\n", selectSex);
                printf("</select><br />\n");
         printf("</div>\n");
        printf("<div class=\"info\">\n");
        printf("<div class=\"b1\">\n");
            printf("<label for=\"birth\">Birthday:</label>\n");
                printf("<select class=\"birth\" select name=\"month\" size=\"1\" id=\"birth\" readonly>\n");
                    printf("<option selected>%s</option>\n", Month);
                   
                printf("</select>\n");
                printf("<select class=\"birth1\" select name=\"day\" size=\"1\" readonly>\n");
                    printf("<option selected>%s</option>\n",Day);
                    
                printf("</select>\n");
                printf("<select class=\"birth2\" select name=\"year\" size=\"1\" readonly>\n");
                    printf("<option selected>%s</option>\n", Year);
					
                printf("</select><br />\n");
        printf("</div>\n");
        printf("</div>\n");
        printf("<p class=\"why\">Why do I need to provide this?</p>\n");
        printf("<div class=\"button\">\n");
            printf("<input type=\"image\" img src=\"/images/sign.png\" name=\"submit\" >\n");
        printf("</div>\n");
    printf("</div>\n");
}

void printHTTPResponseHeader()
{
    printf("Content-type: text/html;charset=utf-8\n\n");
}

void printHTMLHead(void)
{
    printf( "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\">\n" );
    printf( "<html>\n" );
    printf( "<head>\n" );
    printf( "<title>Form</title>\n" );
    printf("<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/form.css\">\n");
    printf( "</head>\n" );
    printf( "<body>\n" );
}


void printHTMLEnd(void)
{
    printf( "</body>\n" );
    printf( "</html>\n" );
}
